The technology described herein to a method of and apparatus for processing computer graphics, and in particular to such a method and apparatus for use in a tile-based graphics processing system.
As is known in the art, graphics processing is normally carried out by first splitting the scene to be displayed into a number of similar basic components or “primitives”, which primitives are then subjected to the desired graphics processing operations. The graphics “primitives” are usually in the form of simple polygons, such as triangles, and are usually described by defining their vertices.
FIG. 1 is a flow chart which shows a selected few steps performed in a conventional graphics processing system to render an output. First the geometry (the primitives) to be processed is defined in a three dimensional “user” space (step 1, “Geometry processing”) and then it is transformed into a two dimensional “screen” space, i.e. from the viewpoint of the viewer of the display (step 2, “Transformed geometry”).
Many graphics processing systems use so-called “tile-based” rendering. In tile-based rendering, the two-dimensional render output or target (i.e. the screen space output of the rendering process, such as an output frame to be displayed) is rendered as a plurality of smaller area sub-regions, usually referred to as “tiles”. The tiles are each rendered separately (for example one-after-another). The rendered tiles are then recombined to provide the complete rendering output (e.g. frame for display). In such arrangements, the render target (output) is typically divided (by area) into regularly-sized and shaped rendering tiles (they are usually e.g., squares or rectangles) but this is not essential.
Other terms that are commonly used for “tiling” and “tile-based” rendering include “chunking” (the rendering tiles are referred to as “chunks”) and “bucket” rendering. The terms “tile” and “tiling” will be used hereinafter for convenience, but it should be understood that these terms are intended to encompass all alternative and equivalent terms and techniques.
FIG. 2 shows an exemplary rendering output 101 (e.g. frame for display) that is divided into a 4 by 4 array of square tiles, i.e. 16 tiles in total. Arranged within the rendering output 101 are two primitives 102, 103 (the transformed geometry in screen space). The primitives 102, 103 each cover a respective tile 104, 105 completely and a number of surrounding tiles partially. The primitives 102, 103 also overlap each other with the primitive 102 that is closer to the viewer being displayed in front of the other primitive 103. (Although it cannot be seen from the two dimensions of the rendering output 101, as defined in the three dimensional user space, the primitives 102, 103 also have a depth range that they span.)
As shown in FIG. 1, in a tile-based rendering system, the transformed geometry (primitives, e.g. the primitives 102, 103 shown in FIG. 2) for the render target is sorted into the tiles that the rendering process operates on (step 3, “Tiling”).
The tiling process identifies those primitives that are actually present in a given rendering tile (so as to, e.g., avoid unnecessarily rendering primitives that are not actually present in a tile). In conventional tiling systems, this tiling process produces for each rendering tile a list of the primitives to be rendered for that rendering tile (e.g. that will appear in the tile) (step 4, “Triangle lists per tile”). Such a “primitive-list” (which can also be referred to as a “tile list”) identifies (e.g. by reference to a primitive indicator) the primitives to be rendered for the tile in question.
FIGS. 3a, 3b, 3c and 3d show, for the example shown in FIG. 2, the result of the tiling process, i.e. the identification of which primitives are present in the tile, for the rendering output 101. As shown in FIG. 3a, there are some tiles 106 which do not contain any primitives. As shown in FIG. 3b, there are some tiles 107 which are contain only the front primitive 102. As shown in FIG. 3c there are some tiles 108 which contain only the rear primitive 103. As shown in FIG. 3d there are some tiles 109 which contain both primitives 102, 103. From this identification of the different primitives (or lack thereof) in the different tiles, a primitive list can be produced for each tile.
The lists of primitives (the tile lists) are then used to identify the primitives to be rendered for each tile (and the primitives in question are then rendered (step 5, “Fragment processing”)).
The Applicants believe that there remains scope for improvements to the processing of primitives in tile-based graphics processing systems.
Like reference numerals are used for like components where appropriate in the drawings.